package Spiel.Werte;

public class Dimension implements IDimension {

	private final double breite, hoehe, tiefe;

	public Dimension(double breite, double hoehe, double tiefe) {
		this.breite = breite;
		this.hoehe = hoehe;
		this.tiefe = tiefe;
	}

	@Override
	public double getBreite() {
		return breite;
	}

	@Override
	public double getHoehe() {
		return hoehe;
	}

	@Override
	public double getTiefe() {
		return tiefe;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		long temp;
		temp = Double.doubleToLongBits(breite);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		temp = Double.doubleToLongBits(hoehe);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		temp = Double.doubleToLongBits(tiefe);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		Dimension other = (Dimension) obj;
		if (Double.doubleToLongBits(breite) != Double
				.doubleToLongBits(other.breite)) {
			return false;
		}
		if (Double.doubleToLongBits(hoehe) != Double
				.doubleToLongBits(other.hoehe)) {
			return false;
		}
		if (Double.doubleToLongBits(tiefe) != Double
				.doubleToLongBits(other.tiefe)) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "Dimension [breite=" + breite + ", hoehe=" + hoehe + ", tiefe="
				+ tiefe + "]";
	}
}
